package com.gohead.server.crawel.models;

import com.gohead.server.crawel.utils.Md5Utils;
import org.springframework.data.annotation.Id;

import java.io.Serializable;
import java.sql.Date;

public class WebRequest implements Serializable {
    private static final long serialVersionUID = 5530967887740663197L;

    @Id
    private String id;

    private String country;

    private String uri;

    private String datetime;

    private Long expiredTime;

    private java.sql.Date createdTime;

    private java.sql.Date modifiedTime;

    public static String buildId(WebRequest task) {
        return Md5Utils.md5(String.format("%s-%s", task.uri, task.country));
    }

    public Date getParitionTime() {
        return paritionTime;
    }

    public void setParitionTime(Date paritionTime) {
        this.paritionTime = paritionTime;
    }

    private java.sql.Date paritionTime;


    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public String getDatetime() {
        return datetime;
    }

    public void setDatetime(String datetime) {
        this.datetime = datetime;
    }

    public Long getExpiredTime() {
        return expiredTime;
    }

    public void setExpiredTime(Long expiredTime) {
        this.expiredTime = expiredTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getModifiedTime() {
        return modifiedTime;
    }

    public void setModifiedTime(Date modifiedTime) {
        this.modifiedTime = modifiedTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
}
